package com.aiit.service.impl;

import com.aiit.dao.ICustomerDao;
import com.aiit.pojo.Customer;
import com.aiit.service.ICustomerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl extends ServiceImpl<ICustomerDao, Customer> implements ICustomerService {
    @Autowired
    ICustomerDao customerDao;
    @Override
    public void insert(Customer customer) {
        customerDao.insert(customer);
    }

    @Override
    public Integer queryAddressByCId(Integer cId,String address) {
        return customerDao.queryAddressByCid(cId,address);
    }

    @Override
    public Integer insertAddress(Integer id, String address) {
        return customerDao.insert2(id,address);
    }

    @Override
    public Integer queryByName(String name) {
        return customerDao.querByName(name);
    }

    @Override
    public List<Customer> queryAll() {
        return customerDao.selectList(null);
    }
}
